#include "App.h"
#include "Battery.h"
#include "Buzzer.h"

#define LOW_POWER 11.1

float voltage;
u8 is_low_power(){
    return voltage < LOW_POWER;
}
void task_battery() _task_ TASK_BATTERY
{
    
    Battery_Init();
    while (1)
    {
        voltage = Battery_get_voltage();
        if (is_low_power())
        {
            Buzzer_alarm3();
        }
        
        os_wait2(K_TMO, 200);
        os_wait2(K_TMO, 200);
    }
}